<%@page contentType="text/html;charset=UTF-8"%>
<%@ page import="whf.framework.web.Constants"%>

<%@taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tlds/framework.tld" prefix="framework"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><framework:attr source="STRUTS-META" attr="name" /></title>
<jsp:include page="/common/inc/select.jsp" />
</head>
<%
String categoryId = request.getParameter("ext1");
if(categoryId == null){
	categoryId = (String)request.getAttribute("ext1");
}
String queryString = "";
if(categoryId == null){
	queryString = "t.category is null";
} else {
	queryString = "t.category.id = "+categoryId;
}
%>
<body>
<html:form action='<%=  (String)request.getAttribute(Constants.STRUTS_PATH) %>' method="post">
<html:hidden property="webMethod" value="" />
<framework:ext />
<framework:table pkStyle="checkbox_counter" navPosition="both" queryString="<%= queryString %>">
<framework:caption><span class="whf_object_title"><framework:attr source="STRUTS-META" attr="name" /></span></framework:caption>
<framework:column property="imageFile" displayTitle="&nbsp;" dataType="String" displayType="ImageFile"><%
String imageFile = (String)whf.framework.util.BeanUtils.getProperty(request.getAttribute("currentRow"), "imageFile");
if(imageFile != null && imageFile.indexOf(".") > 0){
	int p = imageFile.lastIndexOf(".");
	imageFile = imageFile.substring(0, p) + ".small." + imageFile.substring( p + 1);
} else {
	imageFile = "";
}
%><%= imageFile %></framework:column>
<framework:column property="name" displayTitle="名称" dataType="String" />
<framework:column property="price" displayTitle="单价" />
<framework:column property="retailPrice" displayTitle="零售价" />
<framework:column property="discount" displayTitle="折扣" />
<framework:column property="stock" displayTitle="储量" />
<framework:column property="size" displayTitle="大小" />
<framework:column property="weight" displayTitle="重量(KG)" />
</framework:table>
<framework:funcbtn operation="prepareCreate" validationFunction="" valueKey="form.create" />
<framework:funcbtn operation="prepareUpdate" validationFunction="selectionMoreThanOne" valueKey="form.update" />
<framework:funcbtn operation="duplicate" 	validationFunction="selectionMoreThanOne" valueKey="form.duplicate" />
<framework:funcbtn operation="delete" 		validationFunction="selectionMoreThanOne" valueKey="form.delete" />
<html:reset><bean:message key="form.reset" /></html:reset>
</html:form>

</body>
</html> 